<?php
// 获取数据库提交的申请

$data = array();
$sql = "SELECT lid,flink,sitename,name,phone,status,apply_time FROM `flink_tb` WHERE status=0";
if (!my_mysql_query($sql, $data)){
	show_msg(1,'数据查询失败', 3, 'index.php?action='.$action);
	exit();
}

?>
<style type="text/css">
#table{
	text-align: center;
}
#table td,#table th{
	padding: 0 15px;
	border-bottom: 1px solid rgb(210,210,210);
}
#table td button {
	width: 79px;
	height: 32px;
	color: white;
	font-size: 14px;
	border:none;
	outline:none;
	cursor:pointer;
	background: url(image/agree.png) 0 0 no-repeat;
}
</style>

<table id="table" cellspacing="0">
	<caption><h1>新的申请</h1></caption>
	<tr>
		<th>申请id</th>
		<th>申请人</th>
		<th>申请电话</th>
		<th>网站名称</th>
		<th>申请时间</th>
		<th>截止时间</th>
		<th>操作</th>
	</tr>

	<?php
	foreach($data as $flink){
		echo '<tr>';
		echo '<td>'.$flink['lid'].'</td>';
		echo '<td>'.$flink['name'].'</td>';
		echo '<td>'.$flink['phone'].'</td>';
		echo '<td> <a href="'.$flink['flink'].'">'.$flink['sitename'].'</a></td>';
		echo '<td>'.date('Y-m-d',$flink['apply_time']).'</td>';


		// 提交不同的表单,没有好的解决方案
		echo '<form action="flink_handler.php" method="POST">';
		echo '<input type="hidden" name="action" value="'.$action.'">';
		echo '<td><input type="date" name="end_time"></td>';
		echo '<td><button type="submit" name="linkid" value="'.$flink['lid'].'">同意</button>';
		echo '</form>';
		echo '</tr>';
	}

	?>
</table>


